<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-statistic.php");
?>





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
<link href="../asset/css/style.css" rel="stylesheet" type="text/css"/>

</head>

<body>

<div id="topbar">   <?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="unit">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">
<h1><?echo $detail['name']?></h1>

<div class="detail-box layui-form">

<div class="detail-boxes">
<ul class="detail-boxing">






    <div class="content detail-staitics-info">
        <fieldset class="layui-elem-field layui-field-title">
            <legend> 基本信息 </legend>
        </fieldset>


<!--        //todo 数据库要加上icon项，-->
<!--        //todo 添加修改页面要增加上传图片的功能，参考member页面-->
<!--        //todo icon显示的地方要做到能够等比例缩放，参考移植  member list页面，或者前台的写法-->



        <div class="company">
            <div class="leftside">

            <div class="msg">
                <div class="icon">
                    <?if((!$detail['icon'])or($detail['icon']=='')or($detail['icon']=='e')){$detail['icon']="alpha.gif";}?>
                    <img width="100"  src="/uploadfiles/<?echo $detail['icon']?>" >
                </div>


                <div class="information">
                    <text class="company-name"><?echo $detail['name']?>
                        <a href="detail-edit.php?nid=<? echo $detail['nid']?>" class="layui-btn"> <i class="layui-icon">&#xe642;</i> 修改 </a>
                    </text>

                    <div class="identification">
                        <text class="mar">企业识别码：<?echo $detail['idnumber']?></text>
                        <text class="mar">头衔：<?echo $detail['position']?></text>
                        <text class="mar">类型：<?echo $detail['type']?></text>
                        <text >行业：<?echo $detail['industry_type']?></text>
                    </div>

                    <text>地址：<?echo $detail['address']?></text>
                    <div class="tags">
                        <?foreach($now_unit_tag_array as $k=>$V)
                        {?>
                            <span><?echo $V?></span>
                        <?}?>
                    </div>

                </div>


            </div>


            <div class="company-contact">
                <text>法人代表：<?echo $detail['faren']?></text>
                <text >联系电话：<?echo $detail['phone']?></text>
                <text>邮箱：<?echo $detail['email']?></text>
                <text>传真：<?echo $detail['fax']?></text>
            </div>
            <div class="earnings">
                <div class="sbox">
                    <text>项目数:<?echo count_by_item($table_Prefix."case","unit='".$detail['nid']."'")?></text>
                    <div class="relation">
                        <text class="state"><?echo $detail['favourable']?></text>
                        <text>好感度</text>
                    </div>
                </div>
                <div class="sbox">
                    <text>项目金额	:<?echo sum_total($table_Prefix."case","sum","unit='".$detail['nid']."' and status = '完成'")?></text>
                    <div class="relation">
                        <text class="state"><?echo $detail['relation']?></text>
                        <text>关系</text>
                    </div>
                </div>
                <div class="sbox">
                    <text>消费排行	:<?echo $detail['cost']?></text>
                    <div class="relation">
                        <text class="state"><?echo $detail['status']?></text>
                        <text>状态</text>
                    </div>
                </div>
                <div class="sbox">
                    <text>利润排行	:<?echo $detail['profit']?></text>
                    <div class="relation">
                        <text class="state"><?echo $detail['rank']?></text>
                        <text>评级</text>
                    </div>
                </div>
            </div>




            </div>


            <div class="log">
                <?
                for($i=0;$i<count($detail_history);$i++){ ?>
                    <div class="loglist">
                        <div class="content"><? echo $detail_history[$i]['content']; ?></div>
                        <div class="name">修改人：<? echo $detail_history[$i]['authur']; ?></div>
                        <div class="date"><? echo $detail_history[$i]['modifytime']; ?></div>

                    </div>
                <? } ?>
            </div>

        </div>









        <div class="layui-tab layui-tab-brief"  >
            <ul class="layui-tab-title">
                <li class="layui-this">项目统计 </li>
                <li>财务明细</li>
                <li>相关人员</li>
                <li>设置</li>
            </ul>
            <div class="layui-tab-content"  >

                <div class="layui-tab-item  layui-show">
                    <? include "module/case-finance.php" ?>
                </div>

                <div class="layui-tab-item ">
                    <? include "module/finance-list.php" ?>
                </div>

                <div class="layui-tab-item contact">
                    <? include "modules/detail-member.php" ?>

                </div>
                <div class="layui-tab-item">
                    <?php include "modules/mod-setting.php"; ?>
                </div>
            </div>
        </div>














</ul>
</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>
</html>

